/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package myftp.core.view;

import java.awt.BorderLayout;
import javax.swing.JComponent;
import javax.swing.JSplitPane;

/**
 *
 * @author CAVARLE Glenn, LUCAS Stéphane
 *
 * classe pour générer une application multisplit (utilisable comme mainView)
 *
 */
public class MultiSplitView extends AbstractView {

    /**
     * composant de menu
     * @var toolbar
     */
    public JComponent toolbar = null;
    /**
     * composant en haut de l'application
     * @var top
     */
    public JComponent top = null;
    /**
     * composant au centre de l'application
     * @var center
     */
    public JComponent center = null;
    /**
     * composant en bas de l'application
     * @var bottom
     */
    public JComponent bottom = null;

    /**
     * constructeur
     * création du layout
     */
    public MultiSplitView() {
        this.setLayout(new BorderLayout());
    }

    /**
     * initialisation du multisplit
     * @return MultiSplitView
     */
    public MultiSplitView init() {
        this.add(toolbar, "North");
        JSplitPane Vsplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, top,
                new JSplitPane(JSplitPane.VERTICAL_SPLIT, center, bottom));

        this.add(Vsplit, "Center");
        return this;
    }
}
